﻿using ITXHWEB.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using ReflectionStudio.Core.Events;
namespace ITXHWEB.Controllers
{
    public partial class JLTRSPDCController : ITXController
    { 
        public JLTRSPDCController()
        { 
            if (!IsLogOn)
            { 
                return;
            } 
            MAPP = "JLTRSPDC";
            MABF.PDCTYPE = "RS"; 
            foreach (KeyValuePair<string, object> kp in ENVMAIN)
            {
                TempData[kp.Key] = kp.Value;
            }
        }
        public ActionResult JLTRSPDC()
        {
            if (!IsLogOn)
            {
                return View();
            }
            if (MABF.ABES == null)
            {
                MABF.IsGotABE = true;
            }
            else
            {
                var result = MABF.ABES.Where(p => p.IsGet == false).OrderBy(p => p.MSETID);
                if (result.Count() == 0)
                {
                    MABF.IsGotABE = true;
                }
            }
            MABF.PDCTYPE = "RS";
            MABF.REMARK = INFO;
            ViewBag.IsPDCReady = MABF.IsPDCReady;
            ViewBag.IsABPReady = MABF.IsABPReady;
            ViewBag.IsAMReady = MABF.IsAMReady;
            ViewBag.IsSTEPReady = MABF.IsSTEPReady;
            ViewBag.IsStaffReady = MABF.IsStaffReady;
            ViewBag.IsStartReady = MABF.IsStart;
            ViewBag.IsGotABE = MABF.IsGotABE;
            ViewBag.ReturnUrl = Url.Action("JLTRSPDC");
            return View();
        }
    }
}
